<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/*Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});*/
Route::group(['namespace'=>'Api\V1', 'as'=> 'api.', 'prefix'=>''], function() {
	
	Route::post('login', 'AuthenticateController@authenticate');
	//是否登录token检测,访问频率限制每分钟60次,达到次数等待30s
	Route::group(['middleware'=>['jwt.auth','throttle:60,30'] ], function(){
		Route::get('test', 'ApiTestController@index')->name('test');
	});


	///
	Route::get('redirect', 'PassportController@redirect')->name('redirect');

});
